﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Register : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
    {

        // Create an empty Profile for the newly created user
        ProfileCommon p = (ProfileCommon)ProfileCommon.Create(CreateUserWizard1.UserName, true);

        // Populate some Profile properties off of the create user wizard
        p.Name = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Name")).Text;
        p.Surname = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Surname")).Text;
        p.LastName = (((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("LastName")).Text);
        p.Phone = (((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Phone")).Text);
        p.Save();
    }
}
